# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=reverseip
pkgver=13.42cc9c3
pkgrel=11
pkgdesc='Ruby based reverse IP-lookup tool.'
groups=('blackarch' 'blackarch-recon')
arch=('any')
url='https://github.com/lolwaleet/ReverseIP'
license=('custom:unknown')
depends=('ruby' 'ruby-colorize' 'ruby-mechanize' 'ruby-mini_portile2')
makedepends=('git')
source=("$pkgname::git+https://github.com/lolwaleet/ReverseIP.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i '1 i\#!/usr/bin/env ruby' revIP.rb
}

package() {
  cd $pkgname

  install -Dm 755 revIP.rb "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

